package org.flashamaphone.tones
{
	public class Polynote extends Polytone
	{
		/** current note designation */
		protected var _currentDesignations:Array;
		
		/** 
		 * constructor
		 * 
		 * @param note designation
		 * @param octave
		 * @param duration
		 */
		public function Polynote(designations:Array = null, duration:Number = 1)
		{
			super();
			this.duration = duration;
			
			if (!designations) {
				designations = new Array();
			}
			this.designations = designations;
		}
		
		/**
		 * designation setter
		 * 
		 * @param note designation
		 */
		public function set designations(value:Array):void {
			_currentDesignations = value;
			_tones = new Vector.<ITone>();
			for each (var d:String in value ) {
				var note:Note = new Note(d, 4, this.duration);
				_tones.push(note as Tone);
			}
		}
		
		/**
		 * designation getter
		 * 
		 * @return note designation
		 */
		public function get designations():Array {
			return _currentDesignations;
		}
	}
}